home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / msoftapp.zip / TEXTVIEW.CPP < prev    next >
C/C++ Source or Header  |  1993-06-01  |  2KB  |  98 lines

  1. // textview.cpp : implementation of the CTextView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "circle.h"
  6.  
  7. #include "circldoc.h"
  8. #include "textview.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CTextView
  17.  
  18. IMPLEMENT_DYNCREATE(CTextView, CView)
  19.  
  20. BEGIN_MESSAGE_MAP(CTextView, CView)
  21.     //{{AFX_MSG_MAP(CTextView)
  22.     //}}AFX_MSG_MAP
  23.     // Standard printing commands
  24.     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  25.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  26. END_MESSAGE_MAP()
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CTextView construction/destruction
  30.  
  31. CTextView::CTextView()
  32. {
  33.     // TODO: add construction code here
  34. }
  35.  
  36. CTextView::~CTextView()
  37. {
  38. }
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CTextView drawing
  42.  
  43. void CTextView::OnDraw(CDC* pDC)
  44.     {
  45.     CCircleDoc* pDoc = GetDocument();
  46.     CCircle circle = pDoc->GetCircle();
  47.     
  48.     circle.TextOut(pDC);
  49.     }
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CTextView printing
  53.  
  54. BOOL CTextView::OnPreparePrinting(CPrintInfo* pInfo)
  55. {
  56.     // default preparation
  57.     return DoPreparePrinting(pInfo);
  58. }
  59.  
  60. void CTextView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  61. {
  62.     // TODO: add extra initialization before printing
  63. }
  64.  
  65. void CTextView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  66. {
  67.     // TODO: add cleanup after printing
  68. }
  69.  
  70.  
  71.  
  72.  
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CTextView diagnostics
  75.  
  76. #ifdef _DEBUG
  77. void CTextView::AssertValid() const
  78. {
  79.     CView::AssertValid();
  80. }
  81.  
  82. void CTextView::Dump(CDumpContext& dc) const
  83. {
  84.     CView::Dump(dc);
  85. }
  86.  
  87. CCircleDoc* CTextView::GetDocument() // non-debug version is inline
  88. {
  89.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCircleDoc)));
  90.     return (CCircleDoc*) m_pDocument;
  91. }
  92.  
  93. #endif //_DEBUG
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CTextView message handlers
  97.  
  98.